package cn.qiao.rabbitmq;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * desc:
 * mq 消息消费者
 * @author qiao
 * @date 2023年01月04日 17:15
 */
@Component
@RabbitListener(queuesToDeclare = @Queue("directQueue"))//监听的队列名称 directQueue
public class RabbitMQ2Consumer {

    @RabbitHandler
    public void process(Object o) {
        System.out.println("DirectReceiver2消费者收到消息: " + o.toString());
    }

}
